<template>
    <view>
        <u-sticky>
            <view class="cu-list menu sm-border">
                <view class="cu-item">
                    <view class="content">
                    <text class="text-black text-xl">PY2019010007-CD2</text>
                    </view>
                    <view class="action">
                    <text class="text-black text-xl">重庆雅恒房地产开发有限公司给水工程裁断</text>
                    </view>
                </view>
            </view>
        </u-sticky>
        <view class="cu-card">
            <view class="cu-item shadow" @click="add('查看')">

                <view class="cu-form-group">
                    <view class="title">设计变更编号</view>
                    <view>PY2022050131</view>
                </view>
                <view class="cu-form-group">
                    <view class="title">分单编号</view>
                    <view>QSD1</view>
                </view>
                <view class="cu-form-group">
                    <view class="title">提交时间</view>
                    <view>2024-03-12</view>
                </view>
                <view class="cu-form-group">
                    <view class="title">收货日期</view>
                    <view> 2024-03-15</view>
                </view>
                <view class="cu-form-group" style="min-height: 0;"></view>
                <view class="cu-bar bg-white">
                    <view class="action text-black">到货单</view>
                </view>
                <view class="cu-form-group">
                    <view class="grid col-4 grid-square flex-sub">
                        <view class="bg-img" v-for="(itemImg,index) in daohuo_pic" :key="itemImg.url" @tap.stop="ViewImage(daohuo_pic,$event)" :data-url="daohuo_pic[index].url">
                        <image :src="daohuo_pic[index].url" mode="aspectFill"></image>
                            <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
                            </view>
                        </view>
                    </view>
                </view> 
            </view>

            <view class="cu-item shadow" @click="add('查看')">

                <view class="cu-form-group">
                    <view class="title">设计变更编号</view>
                    <view>PY2022050132</view>
                </view>
                <view class="cu-form-group">
                    <view class="title">分单编号</view>
                    <view>QSD1</view>
                </view>
                <view class="cu-form-group">
                    <view class="title">提交时间</view>
                    <view>2024-03-13</view>
                </view>
                <view class="cu-form-group">
                    <view class="title">收货日期</view>
                    <view> 2024-03-18</view>
                </view>
                <view class="cu-form-group" style="min-height: 0;"></view>
                <view class="cu-bar bg-white">
                    <view class="action text-black">到货单</view>
                </view>
                <view class="cu-form-group">
                    <view class="grid col-4 grid-square flex-sub">
                        <view class="bg-img" v-for="(itemImg,index) in daohuo_pic" :key="itemImg.url" @tap.stop="ViewImage(daohuo_pic,$event)" :data-url="daohuo_pic[index].url">
                        <image :src="daohuo_pic[index].url" mode="aspectFill"></image>
                            <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
                            </view>
                        </view>
                    </view>
                </view> 
            </view>
            
        </view>
        <view style="height: 80px"></view>
        <view class="btn-group cu-bar foot" >
            <button class="cu-btn bg-green shadow-blur" @tap="add">
                <text class="cuIcon-add"></text> 创建
            </button>
        </view>
    </view>
</template>
<script>
  export default{
    data(){
        return{
            daohuo_pic:[{
                        url:"http://192.168.1.49:8080/app/static/image/zfgs/zfgs1.jpg",
                        name:'图片',
                        type:'image/jpeg',
                    },{
                        url:"http://192.168.1.49:8080/app/static/image/zfgs/zfgs2.jpg",
                        name:'图片',
                        type:'image/jpeg',
                    }]
        }
    },
    methods:{
        add(item){
            console.log(item,'item')
            if(item){
                uni.navigateTo({
                    url: '/pages/zfgs/index/shouhuo/add?item='+item
                })
            }else{
                uni.navigateTo({
                    url: '/pages/zfgs/index/shouhuo/add'
                })
            }
        }
    }
  }

</script>
<style lang="scss" scoped>
.cu-bar {
  min-height: 80px;
}
.cu-btn {
  font-size: 16px;
  height: 40px;
}
.foot{
    background: #fff;
}
.cu-item{
  flex-wrap: wrap;
  padding: 15px !important;
}
</style>